import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop018"

#1.点击“添加属性组”，编辑属性组名称“好好学习”，属性组排序“1”。
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
#打开三级菜单
DBshopEnterMenu3(firefox,"商品管理","商品属性","属性分组")
#2.点击“删除”按钮，确认删除，删除成功。
firefox.find_element_by_xpath("//td[contains(.,'%s')]/following-sibling::td[2]/a[2]"%sname).click()
firefox.switch_to.alert.accept()
time.sleep(4)
try:
    firefox.find_element_by_xpath("//td[contains(.,'%s')]"%sname)
    writeLog("%s测试通过"%sname)
except:
    writeLog("%s测试失败"%sname)
    getPhoto(firefox)
firefox.quit()